package org.thunms.framework.utils;

import org.apache.commons.lang3.StringUtils;

public class UtilBoolean {
	/**
	 * 将字符串转换成Boolean值
	 * @param s
	 * @return
	 */
	public static Boolean parseBoolean(String s){
		if (StringUtils.isBlank(s)) {// 解决前台传过来null的BUG
			return null;
		} else if ("1".equals(s.trim())) {//0 is true
			return true;
		}else if("0".equals(s.trim())){
			return false;
		} else {
			return Boolean.parseBoolean(s);
		}
		
	}
}
